package org.xx.bookstore;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.xx.armory.spring5.ArmoryWebApplication;
import org.xx.armory.spring5.mvc.captchacode.CaptchaCodeImageController;
import org.xx.armory.spring5.mvc.captchacode.CaptchaCodeImageProvider;
import org.xx.armory.spring5.mvc.captchacode.KaptchaCodeImageProvider;

@SpringBootApplication
@EnableAutoConfiguration(exclude = {HibernateJpaAutoConfiguration.class})
public class Application
        extends ArmoryWebApplication {
    public static void main(
            String[] args
    )
            throws Exception {
        run(Application.class, args);
    }

    @Bean
    public CaptchaCodeImageProvider captchaCodeImageProvider() {
        return new KaptchaCodeImageProvider();
    }

    @Bean
    public CaptchaCodeImageController captchaCodeImageController() {
        return new CaptchaCodeImageController();
    }
}
